/* PEDEX - Board of Directors | Card + Popup only
   Primary: #1c2b59  Secondary: #2bb093
   The existing HTML and popup JavaScript are unchanged. */

/* ---------- Manager cards ---------- */
.manager-box {
  --manager-primary: #1c2b59;
  --manager-accent: #2bb093;
  --manager-border: #e4eaf0;
  margin-bottom: 24px;
  direction: rtl;
}

.manager-box .imglist.dg-imagebox {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--manager-border);
  border-radius: 10px;
  box-shadow: 0 6px 24px rgba(28, 43, 89, .08);
  text-align: center;
  transition: border-color .25s ease, box-shadow .25s ease, transform .25s ease;
}

.manager-box .imglist.dg-imagebox:hover {
  transform: translateY(-4px);
  border-color: rgba(43, 176, 147, .5);
  box-shadow: 0 14px 32px rgba(28, 43, 89, .13);
}

.manager-box .imglist.dg-imagebox .pic {
  position: relative;
  width: 100%;
  /* aspect-ratio: 3 / 4; */
  height: 280px;
  overflow: hidden;
  background: #eef3f6;
  border-radius: 0;
}

/* Tall portrait frame; top of the source image stays visible. */
.manager-box .imglist.dg-imagebox .pic > img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  margin: 0;
  border-radius: 0;
  object-fit: cover;
  object-position: center top;
  transition: transform .35s ease;
}

.manager-box .imglist.dg-imagebox:hover .pic > img {
  transform: scale(1.025);
  transform-origin: center top;
}

.manager-box .imglist.dg-imagebox .news-cont {
  position: static;
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
  padding: 19px 16px 16px;
}

.manager-box .imglist.dg-imagebox .news-cont h2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 0;
  margin: 0;
  color: var(--manager-primary);
  font-size: 18px;
  font-weight: 800;
  line-height: 1.7;
}

.manager-box .imglist.dg-imagebox .manager-rank {
  height: auto;
  margin: 7px 0 0;
  padding: 3px 10px;
  color: #5d6b7d;
  background: #edf8f5;
  border-radius: 6px;
  font-size: 13px;
  line-height: 1.8;
}

.manager-box .manager-rank:empty,
.manager-box .news-main-p-archive:empty {
  display: none !important;
}

/* DNN edit icon remains accessible to administrators. */
.manager-box .imglist.dg-imagebox .news-cont > a[title="Click to edit"] {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 3;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 30px;
  height: 30px;
  margin: 0;
  padding: 6px;
  background: #fff;
  border-radius: 6px;
  box-shadow: 0 3px 10px rgba(28, 43, 89, .15);
}

.manager-box .imglist.dg-imagebox .news-cont > a[title="Click to edit"] img {
  width: 16px;
  height: 16px;
}

.manager-box .imglist.dg-imagebox .manager-icons-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  width: 100%;
  margin: 15px 0 0 !important;
  padding-top: 14px;
  border-top: 1px solid var(--manager-border);
}

.manager-box .imglist.dg-imagebox .manager-icons-wrapper a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 40px;
  width: 40px;
  height: 40px;
  margin: 0;
  padding: 0;
  color: var(--manager-primary);
  background: #edf8f5;
  border: 1px solid #d4eee7;
  border-radius: 8px;
  text-decoration: none;
  transition: background-color .2s ease, color .2s ease, transform .2s ease;
}

.manager-box .imglist.dg-imagebox .manager-icons-wrapper svg {
  display: block;
  width: 19px;
  height: 19px;
  fill: currentColor;
}

.manager-box .imglist.dg-imagebox .manager-icons-wrapper a:is(:hover, :focus-visible) {
  color: #fff;
  background: var(--manager-accent);
  border-color: var(--manager-accent);
  transform: translateY(-2px);
}

.manager-box .imglist.dg-imagebox .manager-icons-wrapper a:is(:hover, :focus-visible) svg {
  fill: currentColor !important;
}

.manager-box .manager-icons-wrapper a:is([href=""], :not([href])) {
  opacity: .5;
  cursor: default;
  pointer-events: none;
}

/* ---------- Manager detail popup ---------- */
.manager-box .ArticleView-popup {
  position: fixed;
  inset: 0;
  z-index: 9999;
  align-items: center;
  justify-content: center;
  padding: 24px 14px;
  overflow-y: auto;
  background: rgba(12, 24, 55, .72);
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s ease;
  /* No display property: the existing inline style/JS controls visibility. */
}

.manager-box .ArticleView-popup.active {
  opacity: 1;
  pointer-events: auto;
}

.manager-box .ArticleView-popup .news-content {
  position: relative;
  width: 100%;
  max-width: 900px;
  max-height: calc(100vh - 48px);
  margin: auto;
  padding: 26px;
  overflow-x: hidden;
  overflow-y: auto;
  color: var(--manager-primary);
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 22px 65px rgba(12, 24, 55, .28);
  direction: rtl;
  text-align: right;
}

.manager-box .ArticleView-popup .news-content > .row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
}

.manager-box .ArticleView-popup .news-content > .row > .d-flex.justify-content-end {
  display: flex;
  flex: 0 0 100%;
  justify-content: flex-end;
  width: 100%;
  margin-bottom: 12px;
}

.manager-box .ArticleView-popup .popup-close-btn {
  box-sizing: content-box;
  display: block;
  width: 18px;
  height: 18px;
  padding: 9px;
  fill: var(--manager-primary);
  background: #edf8f5;
  border-radius: 7px;
  cursor: pointer;
  transition: background-color .2s ease, fill .2s ease;
}

.manager-box .ArticleView-popup .popup-close-btn:hover {
  background: var(--manager-accent);
  fill: #fff;
}

.manager-box .ArticleView-popup .news-content .image {
  width: 100%;
}

.manager-box .ArticleView-popup .news-content .image img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 460px;
  margin: 0 auto;
  border-radius: 8px;
  object-fit: contain;
}

.manager-box .ArticleView-popup .title-blog {
  margin: 0 0 12px;
  color: var(--manager-primary);
  font-size: clamp(21px, 2vw, 27px);
  font-weight: 800;
  line-height: 1.6;
}

.manager-box .ArticleView-popup .manager-rank:not(:empty) {
  display: inline-block;
  margin: 0 0 12px;
  padding: 4px 10px;
  color: var(--manager-primary);
  background: #edf8f5;
  border-radius: 6px;
}

.manager-box .ArticleView-popup .news-content .col-md-7 > p:not(.manager-rank) {
  height: auto;
  margin: 0 0 12px;
  color: #546174;
  font-size: 15px;
  line-height: 2;
}

@media (max-width: 767px) {
  .manager-box .imglist.dg-imagebox .pic { aspect-ratio: 4 / 5; }
  .manager-box .imglist.dg-imagebox .news-cont { padding: 16px 13px; }
  .manager-box .ArticleView-popup { padding: 10px; }
  .manager-box .ArticleView-popup .news-content {
    max-height: calc(100vh - 20px);
    padding: 17px;
    border-radius: 8px;
  }
  .manager-box .ArticleView-popup .news-content .image img { max-height: 300px; }
  .manager-box .ArticleView-popup .title-blog { margin-top: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  .manager-box .imglist.dg-imagebox,
  .manager-box .imglist.dg-imagebox .pic > img,
  .manager-box .ArticleView-popup,
  .manager-box .manager-icons-wrapper a {
    transition: none;
  }
}
